﻿using habbo.Habbo.Characters;
using habbo.Kernel.Network;
using habbo.Kernel.Packets.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace habbo.Kernel.Packets.com.sulake.habbo.communication.messages.outgoing.messenger
{
    class InitializeMessengerFriends : ServerPacket
    {
        public InitializeMessengerFriends(Session Session) : base(0)
        {
            Session.Character.UpdateMessengerFriends(SystemApp.HabboSystem.MessengerManager.GetMessengerFriends(Session.Character.Id));

            base.Append(1100);
            base.Append(300);
            base.Append(800);
            base.Append(1100);

            base.Append(0); //CATEGORY COUNT

            base.Append(1);

            int MessengerFriend;
            if (Session.getCharacter().Id == 1)
            {
                MessengerFriend = 2;
            }
            else
            {
                MessengerFriend = 1;
            }

            CharacterStatus Status = CharacterStatus.Online;

            base.Append(MessengerFriend);
            base.Append(SystemApp.HabboSystem.CharacterManager.GetUsername(MessengerFriend));
            base.Append(1);
            base.Append(Status == CharacterStatus.Online);
            base.Append(false);
            base.Append(Status == CharacterStatus.Online ? SystemApp.HabboSystem.CharacterManager.GetFigure(MessengerFriend) : string.Empty);
            base.Append(0);//group
            base.Append(Status == CharacterStatus.Offline ? SystemApp.HabboSystem.CharacterManager.GetMotto(MessengerFriend) : string.Empty);
            base.Append(Status == CharacterStatus.Online ? SystemApp.HabboSystem.CharacterManager.GetRealName(MessengerFriend) : string.Empty);
            base.Append("22-07-2012");
            base.Append(false);


            base.Append(100);
            base.Append(0);
        }
    }
}
